#ifndef MY_DEFINE_H
#define MY_DEFINE_H

#ifdef __cplusplus
extern "C" {
#endif

#include <stdint.h>

#ifdef MY_DEFINE_C
#define MY_EXTERN
#else
#define MY_EXTERN extern
#endif

enum mode_e
{
    MODE_ON,
    MODE_SETTING,
};

struct machine_t
{
    enum mode_e    mode;
    int    set_x;
    int    choose_x;
    int    choose_max;
    float* duty_x;
    
    float  duty1;
    float  duty2;
    float  duty3;
    float  duty4;
    float  duty5;
    float  duty6;
    
    float adc1;
    float adc2;
    float adc3;
    float adc4;
    float adc5;
    float adc6;

    float read1;
    float read2;
    float read3;
    float read4;
    float read5;
    float read6;

    float set1;
    float set2;
    float set3;
    float set4;
    float set5;
    float set6;

    short ds18b20_x10;
    float ds18b20_tempture;
};

MY_EXTERN struct machine_t machine
#ifdef MY_DEFINE_C
=
{
    .mode = MODE_ON,
    .choose_x = 1,
		.set_x = 1,
    .choose_max = 6,
    .duty1 =   0.0,
    .duty2 =   0.0,
    .duty3 =   0.0,
    .duty4 =   0.0,
    .duty5 =   0.0,
    .duty6 =   0.0,
    .set1 =   40.0,
    .set2 =   40.0,
    .set3 =   40.0,
    .set4 =   40.0,
    .set5 =   40.0,
    .set6 =   40.0,
}
#endif
;
 
MY_EXTERN void delay_ms(uint32_t ms);

#ifdef __cplusplus
}
#endif

#endif  // MY_DEFINE_H